package com.business.web.controller;

import com.business.form.service.FormFieldInfoService;
import com.business.system.common.base.BaseController;
import com.business.system.model.custom.TitleVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * 用户Controller
 * @ClassName: UserController
 * @author fuce
 * @date 2019-11-20 22:35
 */
@Api(value = "用户数据")
@Controller
@RequestMapping("/page")
public class PageController extends BaseController{

	private String prefix = "page";

	@Autowired
	private FormFieldInfoService formFieldInfoService;

	@GetMapping("/goPage")
	public String threeJs(HttpServletRequest req,ModelMap map) {
		String str="前台";
		setTitle(map, new TitleVo("列表", str+"管理", true,"欢迎进入"+str+"页面", true, false));
		String formId=req.getParameter("form_id");
		map.put("form_id",formId);
		String name=req.getParameter("name");
		if(name!=null&&name.length()>0){
			return prefix + "/"+name;
		}
		return prefix + "/three_01";
	}

	@ApiOperation(value="设备管理页面",notes="设备管理页面")
	@GetMapping("/equipment")
	public String equipment(HttpServletRequest req,ModelMap map) {
		String equipmentTypeId=req.getParameter("equipmentTypeId");
		String hallCode=req.getParameter("hallCode");
		map.put("equipmentTypeId",equipmentTypeId);
		map.put("hallCode",hallCode);
		return prefix + "/equipment";
	}


	@ApiOperation(value="窗口岗位管理",notes="窗口岗位管理")
	@GetMapping("/window")
	public String window(HttpServletRequest req,ModelMap map) {
		String hallId=req.getParameter("hallId");
		map.put("hallId",hallId);
		return prefix + "/post";
	}

	@ApiOperation(value = "用户提交诉求页面",notes = "用户诉求页面")
	@GetMapping("/appeal")
	public String appeal(HttpServletRequest req,ModelMap modelMap){
		modelMap.put("userId",1);
		return prefix + "/appeal";
	}
}
